String clazzTpl({package}) => """
import 'dart:convert';
import 'package:flutter/foundation.dart';
import 'package:$package/api/entity/base_entity.api.dart';

class MyTransformer<T> {
  static BaseEntity<T> _transformerBody<T>(dynamic response) {
    return BaseEntity<T>.fromJson(response, T.toString());
  }

  Future<BaseEntity<T>> transformer(dynamic response) async {
    return compute(_transformerBody, response);
  }

  static T _transformerString<T>(dynamic response) {
    try {
      return jsonDecode(response);
    } catch (e) {}
    return response;
  }

  Future<T> transformerString(dynamic response) async {
    return compute(_transformerString, response);
  }
}
""";
